package com.graduation.roombooking.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.roombooking.dto.AppletRoomListDTO;
import com.graduation.roombooking.dto.RoomListDTO;
import com.graduation.roombooking.pojo.Room;
import com.graduation.roombooking.vo.AddRoomVo;
import com.graduation.roombooking.vo.AppletRoomVo;
import com.graduation.roombooking.vo.RoomUnionQuery;
import com.graduation.roombooking.vo.UpdateRoomBaseInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ZhaoXinyi
 * @since 2022-05-04
 */
@Mapper
public interface RoomMapper extends BaseMapper<Room> {

    List<RoomListDTO> getList(String companyName);

    int addOne(@Param("addRoomVo") AddRoomVo addRoomVo, @Param("companyName") String companyName);

    int updateBaseInfo(@Param("baseInfo") UpdateRoomBaseInfoVo updateRoomBaseInfoVo, @Param("companyName") String companyName);

    //组织管理员删除信息
    int deleteOne(@Param("id") Integer id, @Param("companyName") String companyName);

    List<RoomListDTO> unionQuery(@Param("unionQuery") RoomUnionQuery roomUnionQuery, @Param("companyName") String companyName);

    int sysUpdateStatus(Integer id);

    RoomListDTO getRoomById(Integer roomId);

    List<AppletRoomListDTO> getAppletRoomList(AppletRoomVo appletRoomVo);

    //预约成功，该room使用中
    int appletUpdateInUse(Integer roomId);
}
